#include <stdio.h>

int main()
{
    int arr[10] = {0};
    int n = 0;
    int i = 0;
    int count = 0;
    for(i = 0;i<10;i++)
        {
            scanf("%d",&arr[i]);
        }
    scanf("%d",&n);
    for(i = 0;i < 10;i++)
        {
            if(arr[i] <= n ||arr[i] + 30 <= n)
            {
                count++;
            }
        }

    printf("%d",count);

    return 0;
}
